package com.iot.protocol.iec104;

import com.iot.protocol.iec104.config.Iec104Config;
import com.iot.protocol.iec104.server.Iec104Master;
import com.iot.protocol.iec104.server.Iec104MasterFactory;
import com.iot.protocol.iec104.server.Iec104Slave;
import com.iot.protocol.iec104.server.Iec104SlaveFactory;
import com.iot.protocol.iec104.server.master.handler.Iec104MasterDataHandle;
import com.iot.protocol.iec104.server.slave.handler.Iec104SlaveDataHandle;


public class Application {
    public static void main(String[] args) throws Exception {
        Iec104Config iec104Config  = new Iec104Config();
        iec104Config.setFrameAmountMax((short) 10);
        iec104Config.setTerminalAddress((short) 1);
        Iec104Slave iec104Slave = Iec104SlaveFactory.createTcpServerSlave(2404).setDataHandler(new Iec104SlaveDataHandle()).setConfig(iec104Config);
        iec104Slave.run();

//        Iec104Config iec104Config2  = new Iec104Config();
//        iec104Config2.setFrameAmountMax((short) 1);
//        iec104Config2.setTerminalAddress((short) 1);
//        Iec104Master iec104Master =Iec104MasterFactory.createTcpClientMaster("192.168.210.107", 2404).setDataHandler(new Iec104MasterDataHandle()).setConfig(iec104Config2);
//        iec104Master.run();
    }
}
